# !/usr/usuari/des python
#  -*- coding: utf-8 -*-
"""
@Author        : itgnay
@Time          : 2023/2/26 19:12
@FileName      : 质数.py
@LastEditors   : None
@Editors       : PyCharm
"""

"""素数判断"""


def is_prime(n):
    i = 2
    while i * i <= n:
        if not n % i:
            return False
        i += 1
    return True


"""筛选法"""
n = 100
is_prime = [True] * n
for i in range(2, n + 1):
    if is_prime[i - 1]:
        for j in range(i + 1, n + 1):
            if j % i == 0:
                is_prime[j - 1] = False

for i in range(1, n):
    if is_prime[i]:
        print(i + 1)
